|
|
|
|
|
|
|
Figure 19.11.
Running the SQLTest project. |
|
|
|
|
|
|
|
|
You now have a fully functional data-entry screen for ODBC data sources. You can improve this form by adding other routines that improve the error handling and increase the user friendliness of the form. You even can use this form as a basis for your own ODBC data-entry forms. |
|
|
|
|
|
|
|
|
Looking at Other ODBC Considerations |
|
|
|
|
|
|
|
|
Now that you know how to build ODBC data-entry forms, you should keep in mind a few ODBC-related items as you build ODBC-enabled Visual Basic applications: |
|
|
|
|
|
|
|
|
· ODBC connection usage: With some RDMBS systems, each connection you make counts as a user connection to the back-end data source. If your client has a 10-user license and your Visual Basic application opens three ODBC datasets, only seven connections are left for the entire network. If you run three versions of the same program at the same time, you are using nine connections. SQL Server is able to use smart caching to eliminate this problem, but some systems do not. It is a good idea to minimize the number of open connections your Visual Basic programs require. |
|
|
|
|
|
|
|
|
· Install files: If you are using ODBC to connect to data, you need to include the ODBC setup files with your Visual Basic program setup kit. See the Visual Basic documentation on the Setup Wizard for more information on the required files to include for ODBC-enabled applications. |
|
|
|
|
|
|
|
|
· .INI and Registry settings: A number of ODBC-related variables can affect performance. The 16-bit ODBC interface uses ODBC.INI (the list of defined data sources), ODBCINST.INI (the list of installed ODBC drivers available), and ODBCISAM.INI and ODBCDDP.INI (which deal with the ISAM-type interfaces, such as Microsoft Access, Excel, FoxPro, and so on). In 32-bit systems, this information is stored in the system Registry. Although you should not edit these files directly, you should know where these values are stored when you're debugging your ODBC applications. |
|
|
|
|
|
|
|
|
· Tracing ODBC activity: You can turn on ODBC trace files from the ODBC Administrator program. This enables you to watch the message activity between your application and the ODBC interface, which can be very informative when you're attempting to locate bugs or performance problems. The Trace log does take up a lot of disk space after a short time, though. You should turn on the trace capability only when you absolutely need it. |
|
|
|
|
|